body {
  height: calc(100% - 100px);
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #f6f6f6;
}

.chat-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.chat-window {
  width: 100%;
  height: calc(100% - 0px);
  background-color: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  background-color: #4e8cff;
  color: #fff;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
  padding: 0 20px;
}

.chat-header h1 {
  margin: 0;
  font-size: 18px;
  display: inline-block;
}

.chat-body {
  flex: 1;
  overflow-y: scroll;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
}

.chat-body .message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4px;
}

.chat-body .message .content {
  flex: 1;
  background-color: #f6f6f6;
  border-radius: 5px;
  padding: 5px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-body .message .content a {
  color: #4e8cff;
  text-decoration: underline;
}

.chat-footer {
  display: flex;
  align-items: center;
  height: 50px;
  background-color: #f6f6f6;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
  padding: 0 10px;
}

.chat-footer input[type="text"] {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background-color: transparent;
  font-size: 14px;
  padding: 0 10px;
}

.chat-footer input[type="submit"] {
  width: 80px;
  height: 100%;
  border: none;
  outline: none;
  background-color: #4e8cff;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  margin:0px -10px 0px 0px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

.chat-body .message.sent {
  align-items: flex-end;
}

.chat-body .message.received .avatar {
  order: 2;
  margin-right: 0;
  margin-left: 10px;
}

.chat-body .message.received .content {
  order: 1;
}

.chat-header .settings-btn {
  margin-left: auto;
}

/* 手机竖屏 */
@media screen and (max-width: 480px) {
  .chat-header {
    padding: 0 10px;
  }

  .chat-header h1 {
    font-size: 18px;
  }

  .chat-body {
    padding: 10px;
  }

  .chat-footer {
    padding: 0 5px;
  }

  .chat-footer input[type="text"] {
    font-size: 16px;
  }
  .chat-footer input[type="submit"] {
    font-size: 16px;
  }

  .modal {
    width: 240px;
  }
}

/* iPad 竖屏和横屏 */
@media screen and (min-width: 481px) and (max-width: 1024px) {
  .chat-header {
    padding: 0 15px;
  }

  .chat-header h1 {
    font-size: 16px;
  }

  .chat-body {
    padding: 10px;
  }

  .chat-footer {
    padding: 0 10px;
  }
}

/* 设置按钮 */
.settings-btn {
  cursor: pointer;
  margin-left: 10px;
}

/* 设置面板 */
.settings-panel {
  position: absolute;
  top: 60px;
  right: 10px;
  width: 200px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-panel .settings-item {
  padding: 10px;
  border-bottom: 1px solid #f6f6f6;
  cursor: pointer;
}

.settings-panel .settings-item:last-child {
  border-bottom: none;
}

/* 夜间模式 */
.dark-mode .chat-window {
  background-color: #222;
}

.dark-mode .chat-header {
  background-color: #111;
}

.dark-mode .chat-body {
  background-color: #333;
}

.dark-mode .chat-body .message .content {
  background-color: #3C3C3C;
}
.dark-mode .chat-footer {
  background-color: #111;
}

.dark-mode .chat-footer input[type="submit"] {
  background-color: #111;
}

.dark-mode .settings-panel {
  background-color: #111;
}

.dark-mode .chat-header, .dark-mode .chat-footer input[type="text"] {
  color: #fff;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  display: none;
  z-index: 9999;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
}

.confirm-button {
  /* 这里是确定按钮的样式 */
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  margin: 4px 1px;
  padding: 3px 6px;
  cursor: pointer;
  /* 设置按钮背景为透明 */
  background-color: transparent;
  border: 0px solid black; 
  border-radius: 5px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

.cancel-button {
  /* 这里是取消按钮的样式 */
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  margin: 4px 10px;
  padding: 3px 6px;
  cursor: pointer;
  /* 设置按钮背景为透明 */
  background-color: transparent;
  border: 0px solid black;
  border-radius: 5px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

.modal.active {
  display: block;
}

.modal input[type="text"] {
  width: -webkit-fill-available;
  height: 20px;
  margin-bottom: 10px;
  border: 1px solid #000;
  border-radius: 5px;
  padding: 5px;
  font-size: 14px;
}

.modal button {
  margin-right: 10px;
}

/*模态框震动效果*/
.shake {
  animation: shake 0.5s linear;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
  }
}

/*悬浮通知*/
.notification {
  position: fixed;
  top: 1.2%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px;
  width: 90px;
  height: 12px;
  background-color: #4CAF50;
  color: #111;
  text-align: center;
  z-index: 9999;
  border-radius: 2px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
}

.notification-content {
  font-weight: bold; /* 字体加粗 */
  font-size: 12px;
  line-height: 12px;
}

.notification.success {
  background-color: #F44336;
}

.notification.info {
  background-color: #f6f6f6;
}

.notification.warning {
  background-color: #FF9800;
}

.notification.error {
  background-color: #F44336;
}

/* 删除对话框 */
.dialog {
  position: fixed;
  font-weight: bold;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
}

.dialog-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
}

#confirmYes {
  /* 这里是确定按钮的样式 */
  float: right;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  padding: 3px 6px;
  margin: 4px 8px;
  cursor: pointer;
  /* 设置按钮背景为透明 */
  background-color: transparent;
  border: 0px solid black; 
  border-radius: 5px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

#confirmNo {
  /* 这里是取消按钮的样式 */
  float: right;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  padding: 3px 6px;
  margin: 4px 10px;
  cursor: pointer;
  /* 设置按钮背景为透明 */
  background-color: transparent;
  border: 0px solid black;
  border-radius: 5px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}